package br.ufg.inf.espweb.sgca.web.listener;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import lombok.NoArgsConstructor;

/**
 *
 * @author diCastro
 */
@WebListener
@NoArgsConstructor
public class SessionListener implements HttpSessionListener{
    
    private static final Logger LOGGER = Logger.getLogger(SessionListener.class.getName());
    
    @Override
    public void sessionCreated(HttpSessionEvent se) {
        LOGGER.log(Level.INFO, "Sess\u00e3o HTTP {0} aberta.", se.getSession().getId());
    }
    
    @Override
    public void sessionDestroyed(HttpSessionEvent se) {
        LOGGER.log(Level.INFO, "Sess\u00e3o HTTP {0} fechada.", se.getSession().getId());
    }
}
